package it.polimi.traveldream.entities;

import it.polimi.traveldream.ExcursionDTO;

import java.io.Serializable;

import javax.persistence.*;

import com.sun.istack.internal.NotNull;

import java.sql.Time;
import java.util.List;


/**
 * The persistent class for the excursion database table.
 * 
 */
@Entity
@NamedQuery(name="Excursion.findAll", query="SELECT e FROM Excursion e")
public class Excursion implements Serializable {
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private int id;

	@Lob
	private String description;

	@NotNull
	private double durata;

	private String name;

	@NotNull
	private double price;

	//bi-directional many-to-many association to Custompackage
	/*@ManyToMany(mappedBy="excursions")
	private List<Custompackage> custompackages;*/

	//bi-directional many-to-many association to Package
	@ManyToMany(mappedBy="excursions")
	private List<PackageBase> packages;

	public Excursion() {
	}
	
	public Excursion(ExcursionDTO excursionDTO){
		super();
		this.description=excursionDTO.getDescription();
		this.durata=excursionDTO.getDurata();
		this.name=excursionDTO.getName();
		this.price=excursionDTO.getPrice();
	}

	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getDescription() {
		return this.description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public double getDurata() {
		return this.durata;
	}

	public void setDurata(double durata) {
		this.durata = durata;
	}

	public String getName() {
		return this.name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public double getPrice() {
		return this.price;
	}

	public void setPrice(double price) {
		this.price = price;
	}

	/*public List<Custompackage> getCustompackages() {
		return this.custompackages;
	}

	public void setCustompackages(List<Custompackage> custompackages) {
		this.custompackages = custompackages;
	}

	public List<Package> getPackages() {
		return this.packages;
	}

	public void setPackages(List<Package> packages) {
		this.packages = packages;
	}*/

}